import {Component, OnInit} from "@angular/core";
import {LogOutService} from "./logout.service";
import {Router} from "@angular/router";
/**
 * Created by ybjaa on 2017/4/26.
 */

@Component({
    selector:"my-app",
    template:"正在退出…………",
  providers:[LogOutService]
})
export class LogoutComponent implements OnInit{


    ngOnInit(): void {
        this.logout.logout()
            .then(result=>{
                if (result)
                {
                    this.router.navigate(["login"]);
                }
                else {
                    this.router.navigate(["manage"]);
                }
            })
    }

    constructor(private logout:LogOutService,private router:Router){};

}